<template>


  <div>

    <div style="height: 100px;margin-top: 0px ">
      <div style="float: left;width: 70%;height: 100%">
        <p style="color: black;font-size: 23px;line-height: 23px;font-weight: bold;height: 40px;margin-left: 40%">--  创建的队伍  --</p>
      </div>
      <!--<div style="float: left;width: 30%;height: 100%">-->
        <!--<el-button  type="success" style="margin-bottom: 20px" round @click="jump('GroupBuild')">创建小组</el-button>-->
      <!--</div>-->
    </div>

    <div >
      <div v-for="table in teamData" :key="table.projectname" style="float: left;margin-left: 85px;height: 370px;width: 360px ;background-color: white;margin-top: 50px;box-shadow: 0 8px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04)" >
        <div  style="width: 300px;height: 200px;margin-top: 40px">
          <img :src="table.photo" style="width: 250px;height: 200px;margin-left: 40px">
        </div>
        <div style="height: 30px;width: 370px;line-height: 0px">
          <div  class="text-wrapper" style="height: 30px;width: 360px">
            <p v-if="table.states===2"  style="line-height: 20px">进行中</p>
            <p v-if="table.states===1"  style="line-height: 20px">申请中</p>
            <p style="line-height: 20px">队伍名：{{table.tname}}</p>
          </div>
        </div>
        <div class="text-wrapper" style="width: 300px;height:30px;white-space: pre-wrap;margin-top: 30px" >
          <div style="height: 30px;line-height: 0px ">
            <!--<p style="width: 300px;word-wrap: break-word;height: 80px;line-height: 30px ;margin-top: 30px;overflow: auto">简介： {{table.introduce}}  <a :href=table.doc >点我下载详细信息</a></p>-->
            <el-row style="margin-left: 60px">
              <el-button v-if="table.states===0" type="primary" size="small " round  @click="jumpppp(table.id,table.pid)">申请项目</el-button>
              <el-button type="primary" size="small " round  @click="jumppp(table.id,table.states)">管理</el-button>
            </el-row>
          </div>
        </div>
      </div>
    </div>
  </div>


</template>

<script>
  export default {
    data() {
      return {
        puanduan:'',
        teamData:[]
      }
    },
    mounted: function(){


      var user= JSON.parse(window.sessionStorage.getItem("user"));
      var ff=user.id
      axios.post('/workroom/selectTeamByWid',{
        wid:ff,
        id:ff
      }).then((response) => {
        if( response.data != null){

          var e=response.data
          this.teamData=e
          // console.log(e)
          // var data=[];

          // for(var c=0;c<e.length;c++){
          //
          //   var ee=e[c];
          //   var obj={}
          //   obj.states=ee.states
          //   obj.id=ee.id
          //   obj.groupName=ee.groupname
          //   obj.photo=ee.photo
          //   data[c]=obj
          //   console.log(obj)}
          //
          // this. tableData=data
          // this.puanduan=true;
        }
        else{
          this.puanduan=false
          // this.$notify({
          //   title: '失败',
          //   message: '错误',
          //   type: 'warning',
          //   duration:2000
          // });
        }
      })

    },
    methods: {

      jump(path){
        this.$router.replace({path:path})
      },

      jumpppp(path,path2) {
        console.log(path)
        this.$router.push({
          path: '/projectTeamApply',
          query: {
            mallCode: path,
            mallCode2: path2,
          }
        })


      },
      jumppp(path,path2) {
        console.log(path)
        this.$router.push({
          path: '/TeamMember',
          query: {
            mallCode: path,
            mallCode2:path2
          }
        })


      },

      jumpp(path) {
        console.log(path)
        this.$router.push({
          path: '/GroupAppend',
          query: {
            mallCode: path,
          }
        })


      },


    }}
</script>



<style scoped>

</style>
